import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

class FlutterToastPage extends StatefulWidget {
  final Map<String, dynamic> arguments;
  FlutterToastPage({Key key, this.arguments}) : super(key: key);

  @override
  _FlutterToastPageState createState() => _FlutterToastPageState();
}

class _FlutterToastPageState extends State<FlutterToastPage> {
  @override
  void initState() {
    super.initState();
    print('initState');
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('FlutterToastPage'),
      ),
      body: ListView(
        children: <Widget>[
          ListTile(
            title: Text('showToast'),
            onTap: () {
              Fluttertoast.showToast(
                msg: 'Login success.',
                gravity: ToastGravity.CENTER,
                backgroundColor: Color.fromARGB(180, 0, 0, 0),
              );
            },
          )
        ],
      ),
    );
  }
}
